<template>
	<view class="conter">
		<header-box :title="title"></header-box>

		<view class="conter-text">
			<view class="bgc" v-for="(item,index) in goodsList" :key="index">
				<view class="bgc-image">
					<image :src="item.image" mode=""></image>
				</view>
				<view class="box-text">
					{{item.createtime}}
				</view>
				<view class="box-text">
					{{item.name}}
				</view>
				<view class="box-text">
					数量：{{item.num}} 个
				</view>
				<view class="box-text">
					单位：{{item.unit}}
				</view>
				<view class="box-text">
					{{item.store}}
				</view>
				<view class="box-text">
					分类：{{item.classify}}
				</view>
			</view>
		</view>

		<!-- bg-gradual-green -->
		<!-- <view class="add ">
			<view class="remove" @click="showRemove = true">
				删除
			</view>
			<view class="add-class bg-gradual-green">
				保存
			</view>
		</view> -->



		<!-- 删除的弹框 -->
		<!-- <u-popup v-model="showRemove" mode="center" width="580rpx" height="140px" border-radius="10">
			<view class="tilte-text">提示</view>
			<view class="" style="font-size: 28rpx; color: #999999; text-align: center;">
				确定要删除吗？
			</view>
			<view class="btn-bor">
				<text class="left-bor" @click="showRemove= false">取消</text>
				<text>确定</text>
			</view>
		</u-popup> -->
	</view>
</template>

<script>
	import headerBox from '../../components/header/header.vue'

	export default {
		components: {
			headerBox
		},
		data() {
			return {
				title: '商品详情',
				showRemove: false, // 删除的弹层
				goodsList: [],
			}
		},
		onLoad(e) {
			console.log(e)
			const id = e.id
			this.getGoodsListIngo(id)
		},
		methods: {

			async getGoodsListIngo(id) {
				const res = await this.$u.post("api/Goods/details?id=" + id);
				if (res.code !== 1) return this.$tools.msg(res.msg)
				this.goodsList = res.data
				this.$tools.msg(res.msg)
				console.log(this.goodsList)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.conter {
		width: 100%;
		height: 100%;
		position: relative;
	}

	image {
		width: 100%;
		height: 100%;
	}

	.conter-text {
		padding: 30rpx;

		.bgc {
			width: 100%;
			height: 560rpx;
			padding: 30rpx;
			border-radius: 10rpx;
			background-color: #FFFFFF;

			.bgc-image {
				width: 200rpx;
				height: 160rpx;
			}
		}

		.box-text {
			width: 100%;
			height: 60rpx;
			line-height: 60rpx;
			color: #333333;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
		}
	}
</style>
